package com.dyh.quickdemo.demos.lbdand;

import java.util.concurrent.TimeUnit;

/*
@Author=Joey Wheeler
@Date=2020/12/8 10:13
*/
public class Statistics {
    long startTimeMillis=0;
    int count=0;
    int errorCount = 0;
    int successCount = 0;
    String maxTimeThreName;
    long maxTime = 0;
    long finishTime = 0;//结束统计时间

    public void start(){
        this.startTimeMillis = TimeUtil.currentTimeMillis();
        this.finishTime = startTimeMillis+Params.statisticsStep;
        this.count();
    }

    public void end(){
        this.clear();
    }

    public void count(){
        this.count++;
    }
    private void clear(){
        this.startTimeMillis = 0;
        this.count = 0;
        this.successCount = 0;
        this.errorCount = 0;
        this.finishTime = 0;
        this.maxTime = 0;
        this.maxTimeThreName = null;
    }
}
